package sys

import (
	_ "github.com/go-sql-driver/mysql"
)

type SysRole struct {
	RoleId     uint      `json:"role_id" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID
	CreateTime int       `json:"create_time" gorm:"comment:创建时间"`
	UpdateTime int       `json:"update_time" gorm:"comment:更新时间"`
	DeleteTime int       `json:"delete_time" gorm:"default:0;comment:删除时间"`
	Name       string    `json:"name" gorm:"comment:角色名"`
	Status     int       `json:"status" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"` //用户是否被冻结 1正常 2冻结
	Users      []SysUser `json:"-" gorm:"many2many:sys_user_role;"`
	Rules      []SysRule `json:"rules" gorm:"many2many:sys_role_access;"`
	Titles     string    `gorm:"-"`
}

func (SysRole) TableName() string {
	return "sys_role"
}
